package com.ruoyi.project.business.service.impl;



import java.util.List;

import com.ruoyi.common.utils.DateUtils;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import com.ruoyi.project.business.mapper.BusinessNoticeMapper;

import com.ruoyi.project.business.domain.BusinessNotice;

import com.ruoyi.project.business.service.IBusinessNoticeService;



/**

 * 通知公告Service业务层处理

 * 

 * @author ruoyi

 * @date 2020-10-20

 */

@Service

public class BusinessNoticeServiceImpl implements IBusinessNoticeService 

{

    @Autowired
    private BusinessNoticeMapper businessNoticeMapper;



    /**

     * 查询通知公告

     * 

     * @param id 通知公告ID

     * @return 通知公告

     */

    @Override

    public BusinessNotice selectBusinessNoticeById(Long id)

    {

        return businessNoticeMapper.selectBusinessNoticeById(id);

    }



    /**

     * 查询通知公告列表

     * 

     * @param businessNotice 通知公告

     * @return 通知公告

     */

    @Override

    public List<BusinessNotice> selectBusinessNoticeList(BusinessNotice businessNotice)

    {

        return businessNoticeMapper.selectBusinessNoticeList(businessNotice);

    }



    /**

     * 新增通知公告

     * 

     * @param businessNotice 通知公告

     * @return 结果

     */

    @Override

    public int insertBusinessNotice(BusinessNotice businessNotice)

    {

        businessNotice.setCreateTime(DateUtils.getNowDate());

        return businessNoticeMapper.insertBusinessNotice(businessNotice);

    }



    /**

     * 修改通知公告

     * 

     * @param businessNotice 通知公告

     * @return 结果

     */

    @Override

    public int updateBusinessNotice(BusinessNotice businessNotice)

    {

        businessNotice.setUpdateTime(DateUtils.getNowDate());

        return businessNoticeMapper.updateBusinessNotice(businessNotice);

    }



    /**

     * 批量删除通知公告

     * 

     * @param ids 需要删除的通知公告ID

     * @return 结果

     */

    @Override

    public int deleteBusinessNoticeByIds(Long[] ids)

    {

        return businessNoticeMapper.deleteBusinessNoticeByIds(ids);

    }



    /**

     * 删除通知公告信息

     * 

     * @param id 通知公告ID

     * @return 结果

     */

    @Override

    public int deleteBusinessNoticeById(Long id)

    {

        return businessNoticeMapper.deleteBusinessNoticeById(id);

    }

}
